/*
 * ModelCC, distributed under ModelCC Shared Software License, www.modelcc.org
 */

package test.modelcc.language.imperative.model.statement;

import org.modelcc.Prefix;

import test.modelcc.language.imperative.model.Expression;
import test.modelcc.language.imperative.model.Statement;
import test.modelcc.language.imperative.model.VariableExpression;

public class AssignmentStatement extends Statement 
{
	private VariableExpression lhs;
	
	@Prefix("=")	
	private Expression rhs;
	
	// Execution
	
    public double run ()
    {
    	double result = rhs.eval();
    	
    	lhs.setValue(result);

    	return result;
    }
}
